package com.xauto.pioneer.appuser.adapter;

import android.app.Activity;
import android.view.View;
import android.widget.TextView;

import com.xauto.pioneer.appuser.R;
import com.xauto.pioneer.appuser.model.ReceiptHistoryInfo;

/**
 * Created by Lemon on 2015/12/11.
 * Desc:订单列表 适配器
 */
public class ReceiptHistoryAdapter extends AbsAdapter<ReceiptHistoryInfo> {

    public ReceiptHistoryAdapter(Activity context, int layout) {
        super(context, layout);
    }

    @Override
    public ViewHolder<ReceiptHistoryInfo> getHolder() {
        return new TemplateViewHolder();
    }


    private class TemplateViewHolder implements ViewHolder<ReceiptHistoryInfo> {

        private TextView receipt_total;
        private TextView billing_date;

        @Override
        public void initViews(View v, int position) {
            receipt_total = (TextView) v.findViewById(R.id.tv_receipthistory_total);
            billing_date = (TextView) v.findViewById(R.id.tv_receipthistory_time);
        }

        @Override
        public void updateData(ReceiptHistoryInfo receiptHistoryInfo, int position) {
            receipt_total.setText("开票金额："+receiptHistoryInfo.receipt_total);
            billing_date.setText("开票时间："+receiptHistoryInfo.billing_date);
        }

        @Override
        public void doOthers(ReceiptHistoryInfo orderInfo, int position) {

        }
    }
}
